package com.gopay.common.domain.bank;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

import com.gopay.common.cipher.utils.LoggerMaskUtils;
import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.thoughtworks.xstream.annotations.XStreamOmitField;

/**
 *
 * @ExPayBaseMessage.java
 * @author WangHongFei
 */
public class ExPayBaseMessage extends BaseMessage implements Serializable {


	/**
	 *
	 */
	private static final long serialVersionUID = -515941127816084966L;
	/** 快捷支付类型，签约、解约等 */
	@XStreamOmitField
	protected String exPayOperType;
	/** 持卡人与商户签约时银行签约系统产生的协议号 */
	@XStreamOmitField
	protected String agrmtNo;
	/** 返回信息 */
	@XStreamOmitField
	protected String returnInfo;
	/** 成功失败标识 */
	@XStreamOmitField
	protected boolean isSuccess = false;
	@XStreamOmitField
	protected Map<String, String> exPayHashMap = new HashMap<String, String>();
	// 是否超时 默认flase（是true 否flase）
	@XStreamOmitField
	protected boolean isTimeOut = false;
	@XStreamOmitField
	protected Map<?, ?> mtbPayHashMap;

	// 卡号
	@XStreamOmitField
	protected String cardNo;
	// 有效日期
	@XStreamOmitField
	protected String availableDate;
	// 银行地址
	@XStreamOmitField
	protected String bankUrl;
	// 币种
	@XStreamOmitField
	protected String curCode;
	// 是否快捷支付校验失败 默认flase（是true 否flase）
	@XStreamOmitField
	protected boolean isVerifyFailure = false;
	// 信用卡CVN2/CVV2
	@XStreamOmitField
	protected String cvv2 = "";
	// 证件类型
	@XStreamOmitField
	protected String identityType = "";
	// 证件号
	@XStreamOmitField
	protected String identityCode = "";
	// 持卡人姓名
	@XStreamOmitField
	protected String cardHolder = "";
	// 媒介标识-信用卡绑定手机号
	@XStreamOmitField
	protected String mediaId = "";
	// 支付银行
	@XStreamOmitField
	protected String PayBank = "";
	// 支付卡类型
	@XStreamOmitField
	protected String cardType = "";
	// 短信验证码
	@XStreamOmitField
	protected String validateCode = "";
	// 发送短信最大次数
	@XStreamOmitField
	protected int senMaxCount;
	// 验证短信失败最大次数
	@XStreamOmitField
	protected int failMaxCount;
	// 短信验证码有效期，秒为单位
	@XStreamOmitField
	protected String timeOut;
	// 短信验证内容
	@XStreamOmitField
	protected String smsContent;
	// 浏览器版本号
	@XStreamOmitField
	protected String browser;
	// 手机IMEI标识
	@XStreamOmitField
	protected String imei;
	// 用户ip 用户支付时使用的网络终端IP
	@XStreamOmitField
	protected String userIp;
	// 终端标识 1手机 2电脑
	@XStreamOmitField
	protected String termination;
	// 特殊处理渠道码, 1: 钱包三冲交易固定走易宝渠道
	@XStreamOmitField
	protected String specialChCode;
    // 新增结算金额属性
    @XStreamOmitField
    protected String settleAmt;
    // 快捷API失败通知用，应答码
    @XStreamOmitField
    protected String bankRetCode;


	public String getAgrmtNo() {
		return agrmtNo;
	}

	public void setAgrmtNo(String agrmtNo) {
		this.agrmtNo = agrmtNo;
	}

	public Map<String, String> getExPayHashMap() {
		return exPayHashMap;
	}

	public String getExPayOperType() {
		return exPayOperType;
	}

	public void setExPayOperType(String exPayOperType) {
		this.exPayOperType = exPayOperType;
	}

	public void setExPayHashMap(Map<String, String> exPayHashMap) {
		this.exPayHashMap = exPayHashMap;
	}

	public boolean getIsTimeOut() {
		return isTimeOut;
	}

	public void setIsTimeOut(boolean isTimeOut) {
		this.isTimeOut = isTimeOut;
	}

	public boolean isSuccess() {
		return isSuccess;
	}

	public void setSuccess(boolean isSuccess) {
		this.isSuccess = isSuccess;
	}

	public String getReturnInfo() {
		return returnInfo;
	}

	public void setReturnInfo(String returnInfo) {
		this.returnInfo = returnInfo;
	}

	public String getCardNo() {
		return SensitiveInfoUtils.smartDecryptWithCheck(cardNo);
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getAvailableDate() {
		return availableDate;
	}

	public void setAvailableDate(String availableDate) {
		this.availableDate = availableDate;
	}

	public String getBankUrl() {
		return bankUrl;
	}

	public void setBankUrl(String bankUrl) {
		this.bankUrl = bankUrl;
	}

	public String getCurCode() {
		return curCode;
	}

	public void setCurCode(String curCode) {
		this.curCode = curCode;
	}

	public boolean isVerifyFailure() {
		return isVerifyFailure;
	}

	public void setVerifyFailure(boolean isVerifyFailure) {
		this.isVerifyFailure = isVerifyFailure;
	}

	public String getCvv2() {
		return cvv2;
	}

	public void setCvv2(String cvv2) {
		this.cvv2 = cvv2;
	}

	public String getIdentityType() {
		return identityType;
	}

	public void setIdentityType(String identityType) {
		this.identityType = identityType;
	}

	public String getIdentityCode() {
//		return identityCode;
		return SensitiveInfoUtils.smartDecryptWithCheck(identityCode);
	}

	public void setIdentityCode(String identityCode) {
		this.identityCode = identityCode;
	}

	public String getCardHolder() {
		return SensitiveInfoUtils.smartDecryptWithCheck(cardHolder);
	}

	public void setCardHolder(String cardHolder) {
		this.cardHolder = cardHolder;
	}

	public String getMediaId() {
		return SensitiveInfoUtils.smartDecryptWithCheck(mediaId);
	}

	public void setMediaId(String mediaId) {
		this.mediaId = mediaId;
	}

	public String getPayBank() {
		return PayBank;
	}

	public void setPayBank(String payBank) {
		PayBank = payBank;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public String getValidateCode() {
		return validateCode;
	}

	public void setValidateCode(String validateCode) {
		this.validateCode = validateCode;
	}

	public int getSenMaxCount() {
		return senMaxCount;
	}

	public void setSenMaxCount(int senMaxCount) {
		this.senMaxCount = senMaxCount;
	}

	public int getFailMaxCount() {
		return failMaxCount;
	}

	public void setFailMaxCount(int failMaxCount) {
		this.failMaxCount = failMaxCount;
	}

	public String getTimeOut() {
		return timeOut;
	}

	public void setTimeOut(String timeOut) {
		this.timeOut = timeOut;
	}

	public String getSmsContent() {
		return smsContent;
	}

	public void setSmsContent(String smsContent) {
		this.smsContent = smsContent;
	}

	public Map<?, ?> getMtbPayHashMap() {
		return mtbPayHashMap;
	}

	public void setMtbPayHashMap(Map<?, ?> mtbPayHashMap) {
		this.mtbPayHashMap = mtbPayHashMap;
	}

	public String getBrowser() {
		return browser;
	}

	public void setBrowser(String browser) {
		this.browser = browser;
	}

	public String getImei() {
		return imei;
	}

	public void setImei(String imei) {
		this.imei = imei;
	}

	public String getUserIp() {
		return userIp;
	}

	public void setUserIp(String userIp) {
		this.userIp = userIp;
	}

	public String getTermination() {
		return termination;
	}

	public void setTermination(String termination) {
		this.termination = termination;
	}

	public String getSpecialChCode() {
		return specialChCode;
	}

	public void setSpecialChCode(String specialChCode) {
		this.specialChCode = specialChCode;
	}

    public String getSettleAmt() {
        return settleAmt;
    }

    public void setSettleAmt(String settleAmt) {
        this.settleAmt = settleAmt;
    }

    public String getBankRetCode() {
        return bankRetCode;
    }

    public void setBankRetCode(String bankRetCode) {
        this.bankRetCode = bankRetCode;
    }

	/**
	 * add by zyt , 在输出日志的时候，对卡号做掩码显示，以及对cvn2码做隐藏操作
	 * 2017-3-13
	 * @return
	 */
	@Override
	public String toString() {
		return "ExPayBaseMessage{" +
				"exPayOperType='" + exPayOperType + '\'' +
				", agrmtNo='" + agrmtNo + '\'' +
				", returnInfo='" + returnInfo + '\'' +
				", isSuccess=" + isSuccess +
				", exPayHashMap=" + exPayHashMap +
				", isTimeOut=" + isTimeOut +
				", mtbPayHashMap=" + mtbPayHashMap +
				", cardNo='" + LoggerMaskUtils.maskString(cardNo) + '\'' +
				", availableDate='" + "**** ****" + '\'' +
				", bankUrl='" + bankUrl + '\'' +
				", curCode='" + curCode + '\'' +
				", isVerifyFailure=" + isVerifyFailure +
				", cvv2='" + "****" + '\'' +
				", identityType='" + identityType + '\'' +
				", identityCode='" + LoggerMaskUtils.maskString(identityCode) + '\'' +
				", cardHolder='" + cardHolder + '\'' +
				", mediaId='" + LoggerMaskUtils.maskString(mediaId) + '\'' +
				", PayBank='" + PayBank + '\'' +
				", cardType='" + cardType + '\'' +
				", validateCode='" + validateCode + '\'' +
				", senMaxCount=" + senMaxCount +
				", failMaxCount=" + failMaxCount +
				", timeOut='" + timeOut + '\'' +
				", smsContent='" + smsContent + '\'' +
				", browser='" + browser + '\'' +
				", imei='" + imei + '\'' +
				", userIp='" + userIp + '\'' +
				", termination='" + termination + '\'' +
				", specialChCode='" + specialChCode + '\'' +
				", settleAmt='" + settleAmt + '\'' +
				", bankRetCode='" + bankRetCode + '\'' +
				'}';
	}
}
